<!--
 * @Description: 
 * @Author: 赵华宇
 * @Date: 2025-04-28 15:20:27
 * @LastEditors: 赵华宇
 * @LastEditTime: 2025-04-28 15:29:57
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>空间平移</title>
    <style>
        .father{
            perspective: 1000px;
        }

        .son{
            width: 200px;
            height: 200px;
            margin: 100px auto;
            background-color: pink;
            transition: all 0.5s;
        }
        .son:hover{
            transform: translateZ(-300px);
        }
        /* .box{
            width: 200px;
            height: 200px;
            margin: 100px auto;
            background-color: pink;
            transition: all 1s;
        } */
        /* .box:hover{
            /* 电脑是平面，默认无法观察Z轴平移效果 */
            /* transform:translate3d(100px,200px,300px); */
            /* 3d小括号里面必须逗号隔开三个数 */
            /* transform:translate3d(100px,200px); */
            /* transform: translateX(100px);
            transform: translateY(-100%);
            transform: translateZ(300px); */
        /* } */
    </style>
</head>
<body>
    <div class="box"></div>
    <div class="father">
        <div class="son"></div>
    </div>
</body>
</html>